﻿@{
    Layout = null;
}

<!DOCTYPE html> 

<html>
<head>
    <title>Content</title>
        <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
        <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
     <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js", true)" type="text/javascript"></script>
  	<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/easyui.css", true)"/>
	<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/icon.css", true)"/>
	<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.easyui.min1.2.3.js", true)"></script>
</head>
<body style=" height:100%;">
	<div id="tt" class="easyui-tabs" data-options="tools:'#tab-tools'" style=" height:100%">
	</div>
@*	<div id="tab-tools">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'" title='关闭全部' onClick="removeAllPanel()"></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" title='刷新页面' onClick="r()"></a>
	</div>*@
	<script type="text/javascript">
	    $(function () {
	        $('#tt').tabs({
	            tools: [{
	                iconCls: 'icon-cancel',
	                handler: function () {
	                    removeAllPanel();
	                }
	            }, {
	                iconCls: 'icon-reload',
	                handler: function () {
	                    r();
	                }
	            }]
	        });
	    });
		
	    function r() {
	        var tab = $('#tt').tabs('getSelected');  // get selected panel
	        var url = tab.panel('options').content;
            $("#tt").tabs('update', {
	            tab: tab,
	            options: {
	                content: url
	            }
	        });
	    }
	    function toZm() {
	        $('#tt').tabs('select', '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + '/Content/images/dlicon.jpg" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">桌面</td></tr></table>');
        }

	    function url(obj) {
	        $.ajax({
	            type: 'POST',
	            url: rootPath + '/Domes/GetUrl',
	            data: { FFunctNo: obj },
	            success: function (result) {
	                var List = JSON.parse(result);
	                var tab = $('#tt').tabs('exists', '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>');
	                if (!tab) {
	                    $('#tt').tabs('add', {
	                        id: obj,
	                        title: '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>',
	                        //href: rootPath + '/' + List.FfunctURL,
	                        content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="' + rootPath + '/' + List.FfunctURL + '"></iframe>',
	                        closable: true
	                    });
	                }
	                else {
	                    $('#tt').tabs('select', '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + List.FPictName + '" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">' + List.FfunctName + '</td></tr></table>');
//	                    var tab = $('#tt').tabs('getSelected');  // get selected panel
//	                    $("#tt").tabs('update', {
//	                        tab: tab,
//	                        options: {
//	                            content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="' + rootPath + '/' + List.FfunctURL + '"></iframe>'
//	                        }
//	                    });

	                }
	            }
	        });
	    }
	    var tabs;
	    window.onresize = function () {
	        $("#tt").tabs({ height: parent.document.body.clientHeight - 72 });
	    }
      
	    $(document).ready(function () {
	        $("#tt").tabs({ height:parent.document.body.clientHeight-72 });
	        $('#tt').tabs('add', {
	            title: '<table cellpadding="0" cellspacing="0" ><tr><td><img src="' + rootPath + '/Content/images/dlicon.jpg" style=" border:0px;"/></td><td  style=" padding-right:5px;padding-left:5px">桌面</td></tr></table>',
	            content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="/EnterpriseFund/Index/ContentShow"></iframe>',
	            closable: false
	        });
	    });



	    //	    var index = 0;
	    //	    function addPanel() {
	    //	        index++;

	    //	        $('#tt').tabs('add', {
	    //	            title: '首页',
	    //	            content: '<iframe  id="contentframe name="contentframe" style="width:100%;height:100%" frameborder="0" src="/EnterpriseFund/Domes/ContentShow"></iframe>',
	    //	            closable: false
	    //	        });
	    //	    }
	    function removeAllPanel() {
	        var tab = $('#tt').tabs('tabs');
	        if (tab) {
	            var z = tab.length;
	            for (var i = 1; i < z; i++) {
	                $('#tt').tabs('close', tab[1].panel('options').title);
	            }
	        }
	    }
	</script>
</body>
</html>
